package com.inifitness.sms.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author mageric
 * @version 1.0.0
 * @since 2022/12/10 15:34
 */
@Getter
@AllArgsConstructor
public enum TemplateTypeEnum {
  /**
   * 验证码
   */
  CAPTCHA(0, "验证码"),
  /**
   * 短信通知
   */
  NOTIFY(1, "短信通知"),
  /**
   * 推广
   */
  POPULARIZE(2, "推广短信"),
  /**
   * 国际/港澳台消息
   */
  VERIFY_CODE(3, "国际/港澳台消息");
  private final int code;
  private final String description;

  public static TemplateTypeEnum enumByCode(int code) {

    for (TemplateTypeEnum value : values()) {

      if (value.getCode() == code) {
        return value;
      }

    }
    return null;
  }
}
